package com.baoer.controler;

import com.baoer.R;
import com.baoer.entity.Ordersmall;
import com.baoer.service.OrdersmallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@Transactional(rollbackFor = Exception.class)
public class OrdersmallController {

    @Autowired
    private OrdersmallService ordersmallService;
    //所有的订单
    @RequestMapping(value="/ordersmallList")
    public R ordersmall(@RequestBody Map<String, Object> map){
        return ordersmallService.ordersmallList(map);
    }
    //处理中的订单
    @RequestMapping(value="/ordersmallListDealing")
    public R ordersmallListDealing(@RequestBody Map<String, Object> map){
        return ordersmallService.ordersmallListDealing(map);
    }
    //已确定的订单
    @RequestMapping(value="/ordersmallListDeal")
    public R ordersmallListDeal(@RequestBody Map<String, Object> map){
        return ordersmallService.ordersmallListDeal(map);
    }
    //拒绝的订单
    @RequestMapping(value="/ordersmallListDealfail")
    public R ordersmallListDealfail(@RequestBody Map<String, Object> map){
        return ordersmallService.ordersmallListDealfail(map);
    }
    //订单详情
    //产品信息
    @RequestMapping(value="/ordersmallListInfoProduct")
    public R ordersmallListInfoProduct(@RequestBody Ordersmall ordersmall){
        return ordersmallService.ordersmallListInfoProduct(ordersmall.getId());
    }
    //订单信息
    @RequestMapping(value="/ordersmallListInfoOrder")
    public R ordersmallListInfoOrder(@RequestBody Ordersmall ordersmall){
        return ordersmallService.ordersmallListInfoOrder(ordersmall.getId());
    }
    //供应商单位
    @RequestMapping(value="/ordersmallListStore")
    public R ordersmallListStore(@RequestBody Ordersmall ordersmall){
        return ordersmallService.ordersmallListStore(ordersmall.getId());
    }
    //搜索
    @RequestMapping(value="/ordersmallListSearch")
    public R ordersmallListSearch(@RequestBody Map<String, Object> map){
        return ordersmallService.ordersmallListSearch(map);
    }
}
